<layout name='Layout/layout_page' />

	<ol class="breadcrumb">
		<li><a href="<{:U('Reply/index')}>">关键词回复</a></li>
      	<li><a href="<{:U('Reply/index')}>">列表</a></li>
      	<li class="active">编辑</li>
    </ol>

	<form id="ajaxForm" action="<{:U('Reply/update')}>" method="post" class="form-horizontal form-validata">
		<div class="form-group">
			<label class="col-md-1 control-label" for="name">关键词</label>
			<div class="col-md-11">
				<input type="text"
                class="form-control"
				name="name"
				id="name"
				value="<{$list['name']}>" 
				data-rule-required="true"
				/>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="name">状态</label>
			<div class="col-md-11">
				<label class="radio-inline">
					<input type="radio" name="status" value="1" <php>if($list['status']==='1')echo checked;</php>> 启用
				</label>
				<label class="radio-inline">
					<input type="radio" name="status" value="0" <php>if($list['status']==='0')echo checked;</php>> 禁用
				</label>
			</div>
		</div>

		<div class="form-group">
			<label class="col-md-1 control-label" for="url">回复内容</label>
			<div class="col-md-11">
				<ul class="nav nav-tabs" role="tablist">
    				<li role="presentation" <php>if($list['type']==='1')echo 'class="active"';</php>><a href="#text" type="1" aria-controls="text" role="tab" data-toggle="tab">文本回复</a></li>
					<li role="presentation" <php>if($list['type']==='2')echo 'class="active"';</php>><a href="#article" type="2" aria-controls="article" role="tab" data-toggle="tab">图文回复</a></li>
				</ul>
				
				<div class="tab-content replyBox">
			    	<div role="tabpanel" class="tab-pane <php>if($list['type']==='1')echo active;</php>" id="text">
			    		<textarea name="text" class="form-control areatext" data-rule-required="true"><{$list['text']}></textarea>
			    		
			    	</div>
			    	<div role="tabpanel" class="tab-pane <php>if($list['type']==='2')echo active;</php>" id="article">
			    		<div class="replyArtile" id="replyArtile"><{$artStr}></div>
			    		<button type="button" class="btn btn-success addBtn" onclick="openWindow('选择图文','<{:U('Reply/select')}>','replyArtile')">+选择文章</button>
			    	</div>
				</div>
			</div>
		</div>	

		<div class="form-group">
			<div class="col-md-11 col-sm-offset-1">
				<button type="submit" class="btn btn-info">编辑</button>
			</div>
		</div>
		<input type="hidden" name="id" value="<{$list['id']}>">
		<input type="hidden" name="type" id="type" value="<{$list['type']}>">
	</form>

<script type="text/javascript">
function removeDiv(v){
	$("#aID"+v).remove();
}

$(document).ready(function(){
	$('.nav li a').click(function(){
		$("#type").val($(this).attr('type'));
	})
})
</script>
<input type="hidden" id="menu_action" value="weixin" />
